 import React,{ Component } from 'react'
 import{ 
     MonandBabyStyle,MonBabyTitleStyle,
     MonBabyUlStyle,MonBabyLiStyle,MonBabyImgStyle,
     MonBabyLeftStyle,MonBabyRightStyle
    } from './MonandBabyStyle'

  import { Link } from 'react-router-dom'  
 import Banner from './bannner'
 import HomeCommon from 'pages/home/HomeCommon'
import Footer from 'components/common/footer/Footer'



 const Item = ( props ) => {
     return (
            <MonBabyLiStyle>

            <Link to={"/monbabydetail/"+props.label}>

            <MonBabyImgStyle>
                <img src={ props.image_url_set.main[640] }/>
            </MonBabyImgStyle>

            <MonBabyLeftStyle>
                <h1>{ props.title }</h1>
                <div className="time">
                    仅剩00天23小时20分
                </div>
            </MonBabyLeftStyle>

            <MonBabyRightStyle>
                <img src={ props.image_url_set.brand[800] }/>
            </MonBabyRightStyle>
            </Link>

        </MonBabyLiStyle>
     )
 }

 class MonandBaby extends Component{



    componentDidMount () {
        this.props.getMonAndBabyLists()
        //mon_and_baby_lists
        this.props.change_title('母婴')
    }


    renderItem = () => {
        return this.props.mon_and_baby_lists && this.props.mon_and_baby_lists.map(  item => {
            return <Item key={item.label} {...item}/>
        })
    }

    render ( ) {
        return (
            <MonandBabyStyle>
                <Banner/>

                <MonBabyTitleStyle>
                    <i className="fa fa-th"></i>
                    <span>疯抢专场 早10点上新</span>
                </MonBabyTitleStyle>

                <MonBabyUlStyle>
                    {/* <MonBabyLiStyle>

                        <Link to="/home">

                        <MonBabyImgStyle>
                            <img src="http://mp6.jmstatic.com//jmstore/image/000/007/7793_std/5d3012fa67bdc_1024_512.jpg?1563498924&imageView2/2/w/640/q/90"/>
                        </MonBabyImgStyle>

                        <MonBabyLeftStyle>
                            <h1>保宁品牌专场</h1>
                            <div className="time">
                                仅剩00天23小时20分
                            </div>
                        </MonBabyLeftStyle>

                        <MonBabyRightStyle>
                            <img src="http://p0.jmstatic.com/brand/logo_180/22722.jpg"/>
                        </MonBabyRightStyle>
                        </Link>

                    </MonBabyLiStyle> */}
                    {
                        this.renderItem()
                    }
                </MonBabyUlStyle>
                <Footer/>
                
            </MonandBabyStyle>
        )
    }
 }

 export default HomeCommon(MonandBaby)